{
  "$schema" : "http://json-schema.org/draft/2019-09/schema#",
  "title" : "Provisioning Request",
  "type" : "object",
  "additionalProperties" : false,
  "properties" : {
    "interfaceCategory" : {
      "type" : "string",
      "enum" : [ "Provisioning" ],
      "description" : "CMP categorisation of the job associated with this file."
    },
    "interfaceType" : {
      "type" : "string",
      "enum" : [ "Default" ],
      "description" : "Sub-categorisation of the job"
    },
    "extractDateTime" : {
      "type" : "string",
      "format" : "date-time",
      "description" : "Represents when a third-party file was extracted by CMP"
    },
    "version" : {
      "type" : "number",
      "description" : "The current version of the generic extract file. This must match the corresponding inbound file."
    },
    "subscription" : {
      "$ref" : "#/definitions/Subscription"
    }
  },
  "definitions" : {
    "Subscription" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "subscriberId" : {
          "type" : "integer",
          "description" : "This value identifies a subscriber in CMP"
        },
        "accountId" : {
          "type" : "integer",
          "description" : "This value identifies the account in CMP that is associated with the subscriber"
        },
        "agreementId" : {
          "type" : "integer",
          "description" : "This value identifies the agreement in CMP that is associated with the subscriber"
        },
        "actionItemNumber" : {
          "type" : "integer",
          "description" : "This value identifies an actioned item in CMP"
        },
        "command" : {
          "type" : "string",
          "description" : "This value identifies the command that is associated with the actioned item"
        },
        "commandAttributes" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/CommandAttribute"
          },
          "description" : "Only populated if command associated with commandAttributes"
        },
        "commandDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "This value indicates, if applicable, the date on which a command should take effect at the network"
        },
        "network" : {
          "type" : "string",
          "description" : "This value identifies the network in CMP that is associated with the subscriber"
        },
        "networkType" : {
          "type" : "string",
          "description" : "This value identifies the network type in CMP that is associated with the subscriber"
        },
        "internationalPrefix" : {
          "type" : "string",
          "description" : "This is the international call prefix or dial out code"
        },
        "billingType" : {
          "type" : "string",
          "enum" : [ "PREPAY", "POSTPAY", "COMBINATION" ]
        },
        "billingCycle" : {
          "type" : "integer",
          "description" : "The day of the month on which the subscriber receives their recurring invoice"
        },
        "nextExpectedInvoiceDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "The date on which the subscriber is due to receive their next invoice"
        },
        "actionType" : {
          "type" : "string",
          "description" : "This value identifies the action type in CMP that is associated with the subscriber"
        },
        "actionCode" : {
          "type" : "string",
          "description" : "This value identifies the action code in CMP that is associated with the subscriber"
        },
        "networkActionType" : {
          "type" : "string",
          "enum" : [ "BAR", "CONNECTION", "DISCONNECTION", "NETWORK_SERVICE", "NUMBER_CHANGE", "OTHER", "TARIFF_CHANGE", "UNBAR", "ALLOWANCE", "BILL_CYCLE_CHANGE", "CAP", "DISABLE_FEATURE", "ENABLE_FEATURE" ],
          "description" : "This value identifies the network action type in CMP that is associated with the subscriber"
        },
        "tariffCode" : {
          "type" : "string",
          "description" : "This value identifies the tariff code in CMP that is associated with the subscriber"
        },
        "isConnected" : {
          "type" : "boolean",
          "description" : "This value indicates that the subscription connection date not null and disconnection date is null"
        },
        "subscriptionProperties" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/SubscriptionProperty"
          }
        },
        "feature" : {
          "$ref" : "#/definitions/RequestFeature",
          "description" : "Only populated if command associated with a feature to be enabled or disabled"
        },
        "allowances" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/OutboundAllowance"
          },
          "description" : "Only populated if command associated with allowances to be enabled or disabled"
        },
        "caps" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/CapOutbound"
          },
          "description" : "Only populated if command associated with a caps to be enabled or disabled"
        },
        "retryCount" : {
          "type" : "integer",
          "description" : "This value identifies the number of times the command is retried"
        },
        "eventNumber" : {
          "type" : "integer",
          "description" : "This number is derived via diary event"
        },
        "simProfiles" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/SimProfile"
          },
          "description" : "Only populated if Network Serial Number, with Id 2, that is associated with the subscriptionnumber"
        },
        "sharedGroups" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/SharedGroup"
          },
          "description" : "Only populated if command associated with shared groups to be updated (i.e. subscriptions being added to a group or a group being ended)"
        },
        "ocsRateId" : {
          "type" : "string",
          "description" : "This value identifies the OCS rate allowance at the network"
        },
        "ocsBalanceId" : {
          "type" : "string",
          "description" : "This value identifies the OCS balance allowance at the network"
        },
        "basePackageCode" : {
          "type" : "string",
          "description" : "This value identifies the base package code in CMP that is associated with the subscriber"
        },
        "closedUserGroup" : {
          "$ref" : "#/definitions/ClosedUserGroup",
          "description" : "This value identifies the OCS closed user group at the network"
        }
      }
    },
    "CommandAttribute" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "commandAttributeCode" : {
          "type" : "string",
          "description" : "This value identifies a commandAttributeCode that has been provisioned at the network"
        },
        "commandAttributeValue" : {
          "type" : "string",
          "description" : "This value identifies the commandAttributeValue that has been provisioned at the network"
        }
      },
      "required" : [ "commandAttributeCode", "commandAttributeValue" ]
    },
    "SubscriptionProperty" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "type" : {
          "type" : "string",
          "enum" : [ "SSN", "SNSC", "SA" ],
          "description" : "This value identifies the type of property.  SSN: Subscription Serial Number; SNSC: Subscription Network Sub Code; SA: Subscription Attribute"
        },
        "status" : {
          "type" : "string",
          "enum" : [ "CHANGING", "CURRENT", "SUPERSEDED" ],
          "description" : "This value identifies the status of the property for a subscriber in CMP "
        },
        "id" : {
          "type" : "integer",
          "description" : "A subscription may have many properties of a particular type"
        },
        "description" : {
          "type" : "string",
          "description" : "A description of the property"
        },
        "value" : {
          "type" : "string",
          "description" : "The value of the property for the subscriber"
        }
      }
    },
    "RequestFeature" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "id" : {
          "type" : "string",
          "description" : "This value identifies the network feature in CMP"
        },
        "description" : {
          "type" : "string",
          "description" : "A description of the feature"
        },
        "networkFeatureId" : {
          "type" : "string",
          "description" : "This value identifies the feature at the network"
        },
        "networkFeatureInstanceId" : {
          "type" : "string",
          "description" : "Only populated for DISABLE action. This value uniquely identifies the allocation of an feature to a subscriber at the network"
        },
        "action" : {
          "type" : "string",
          "enum" : [ "ENABLE", "DISABLE", "BAR", "UNBAR" ],
          "description" : "The action to be taken at the network"
        }
      },
      "required" : [ "networkFeatureId" ]
    },
    "OutboundAllowance" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "id" : {
          "type" : "string",
          "description" : "This value identifies the allowance in CMP"
        },
        "ocsAllowanceId" : {
          "type" : "string",
          "description" : "This value identifies the allowance at the network"
        },
        "ocsAllowanceInstanceId" : {
          "type" : "string",
          "description" : "Only populated for DISABLE action. This value uniquely identifies the allocation of an allowance to a subscriber at the network"
        },
        "type" : {
          "type" : "string",
          "enum" : [ "VOICE", "DATA", "TEXT", "MMS", "CASH", "RATE", "OVERAGE", "BALANCE" ]
        },
        "value" : {
          "type" : "integer"
        },
        "effectiveDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "The date the allowance takes effect"
        },
        "expiryDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "The date the allowance expires"
        },
        "action" : {
          "type" : "string",
          "enum" : [ "ENABLE", "DISABLE" ]
        },
        "sharedGroupId" : {
          "type" : "integer",
          "description" : "Identifies the group in CMP, if applicable, that the allowance relates to"
        },
        "ocsSharedGroupId" : {
          "type" : "string",
          "description" : "Identifies the group at the network, if applicable, that the allowance relates to"
        },
        "isRecurring" : {
          "type" : "boolean",
          "description" : "Identifies if the allowance is recurring"
        },
        "isProratable" : {
          "type" : "boolean",
          "description" : "Identifies if the allowance is proratable"
        },
        "cycleUnit" : {
          "type" : "string",
          "description" : "Identifies the cycle unit of the allowance"
        },
        "cycleLength" : {
          "type" : "integer",
          "description" : "Identifies the cycle length of the allowance"
        },
        "proRataValue" : {
          "type" : "string",
          "description" : "Identifies the pro rata value of the allowance"
        },
        "initialRecurDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "Identifies the date on which the allowance will renew"
        }
      }
    },
    "CapOutbound" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "id" : {
          "type" : "string",
          "description" : "This property identifies a particular Cap which is inside the CMP"
        },
        "ocsCapId" : {
          "type" : "string",
          "description" : "This property identifies a particular Cap that has been provisioned at the network"
        },
        "ocsCapName" : {
          "type" : "string",
          "description" : "This value explains the name of the cap at the network"
        },
        "ocsCapInstanceId" : {
          "type" : "string",
          "description" : "This property uniquely identifies the allocation of a cap to a subscriber at the network which will only be pupulated for disabled or changed actions"
        },
        "value" : {
          "type" : "integer",
          "description" : "This property contains the value of CAP"
        },
        "action" : {
          "type" : "string",
          "enum" : [ "ENABLE", "CHANGE", "DISABLE" ],
          "description" : "This property contains the action to be taken at the network"
        },
        "initialRecurDate" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "This value identifies the date on which the cap will renew"
        }
      },
      "required" : [ "id", "ocsCapId", "ocsCapInstanceId", "value", "action" ]
    },
    "SimProfile" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "iccId" : {
          "type" : "string",
          "description" : "This field dictates the start and end digit of the SIM No. to be uploaded"
        },
        "simProfileImsis" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/SimProfileImsi"
          },
          "description" : "This value identifies the simProfileImsi that has been provisioned at the network"
        },
        "simProfileAttributes" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/SIMProfileAttribute"
          },
          "description" : "This value identifies the simProfileAttributes that has been provisioned at the network"
        }
      }
    },
    "SimProfileImsi" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "imsi" : {
          "type" : "string",
          "description" : "International Mobile Subscriber Identity"
        },
        "hlrId" : {
          "type" : "string",
          "description" : "This value identifies the HLRID that has been provisioned at the network"
        }
      }
    },
    "SIMProfileAttribute" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "simProfileAttributeCode" : {
          "type" : "string",
          "description" : "This value identifies the simProfileAttributeCode that has been provisioned at the network"
        },
        "simProfileAttributeValue" : {
          "type" : "string",
          "description" : "This value identifies the simProfileAttributeValue that has been provisioned at the network"
        }
      }
    },
    "SharedGroup" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "sharedGroupId" : {
          "type" : "integer",
          "description" : "Identifies the group in CMP, if applicable, that the allowance relates to"
        },
        "ocsSharedGroupId" : {
          "type" : "string",
          "description" : "Identifies the group at the network, if applicable, that the allowance relates to"
        },
        "sharedAllowances" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/SharedAllowance"
          },
          "description" : "Only populated if command associated with shared allowances to be updated"
        }
      }
    },
    "SharedAllowance" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "allowanceId" : {
          "type" : "string",
          "description" : "This value identifies the allowance in CMP"
        },
        "ocsAllowanceInstanceId" : {
          "type" : "string",
          "description" : "Only populated for DISABLE action. This value uniquely identifies the allocation of an allowance to a subscriber at the network"
        },
        "type" : {
          "type" : "string",
          "enum" : [ "VOICE", "DATA", "TEXT", "MMS", "CASH", "RATE", "OVERAGE", "BALANCE" ]
        },
        "value" : {
          "type" : "integer"
        }
      }
    },
    "ClosedUserGroup" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "id" : {
          "type" : "string",
          "description" : "This value identifies the closed user group"
        },
        "action" : {
          "type" : "string",
          "enum" : [ "ENABLE", "DISABLE" ],
          "description" : "The action to be taken at the closed user group"
        },
        "level" : {
          "type" : "string",
          "enum" : [ "CLOSED_USER_GROUP", "SUBSCRIPTION" ],
          "description" : "The level to be taken at the closed user group"
        }
      }
    }
  }
}